package com.xinqi.modules.course.course.controller.inner;

import com.xinqi.common.base.response.R;
import com.xinqi.modules.course.course.dto.rsp.CourseResultDTO;
import com.xinqi.modules.course.course.service.CourseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


/**
 * 课程表控制层
 *
 * @author: wenjie
 * @date: 2023/03/10
 */
@RestController
@RequestMapping("/inner/course")
@RequiredArgsConstructor
public class CourseInnerController {
    private final CourseService courseService;

    @Operation(summary = "账号注销（课程板块变动）")
    @PostMapping("/accountCancel")
    public R<Boolean> accountCancel(@RequestParam(value = "userId") Long userId) {
        return R.data(courseService.accountCancel(userId));
    }

    @Operation(summary = "账号注销（课程板块变动）")
    @GetMapping("/findCourse")
    public R<CourseResultDTO> findCourse(@RequestParam(value = "courseId") Long courseId) {
        return R.data(courseService.findById(courseId));
    }

}
